package org.csu.mypetstore.service.impl;

import org.csu.mypetstore.persistence.LogMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

@Repository
public class LogMapperImpl implements LogMapper {

    @Autowired
    private JdbcTemplate jdbcTemplate;

    private static final String INSERT_LOG_SQL = "INSERT INTO log (logUserId, logInfo) VALUES (?, ?)";

    @Override
    public void insertLog(String username, String logInfo) {
        jdbcTemplate.update(INSERT_LOG_SQL, username, logInfo);
    }

}
